/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.ImportantDateManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class UpdateImportantDate extends AbstractAction
/*    */ {
/* 21 */   private int id = 0;
/*    */ 
/*    */   public UpdateImportantDate(AbstractHttpServlet servlet) {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public UpdateImportantDate(AbstractHttpServlet servlet, String id) {
/* 28 */     super(servlet);
/* 29 */     this.id = Util.str2Int(id);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 36 */     String type = Util.getURLParameter(request
/* 37 */       .getParameter("ImportantDateType"));
/* 38 */     int month = Util.getURLIntParameter(request
/* 39 */       .getParameter("ImportantDateMonth"));
/*    */ 
/* 41 */     int day = Util.getURLIntParameter(request
/* 42 */       .getParameter("ImportantDateDay"));
/*    */ 
/* 44 */     int year = Util.getURLIntParameter(request
/* 45 */       .getParameter("ImportantDateYear"));
/*    */ 
/* 47 */     User user = super.getLoginUser(request);
/* 48 */     response.setContentType("text/html;charset=utf-8");
/* 49 */     PrintWriter out = response.getWriter();
/*    */ 
/* 51 */     JSONObject jsonObject = new JSONObject();
/*    */ 
/* 53 */     ImportantDateManager manager = new ImportantDateManager();
/*    */ 
/* 55 */     int result = manager.update(this.id, type, month, day, year, 
/* 56 */       user.userId);
/* 57 */     if (result > 0)
/* 58 */       jsonObject.put("error", "0");
/*    */     else {
/* 60 */       jsonObject.put("error", "1");
/*    */     }
/* 62 */     out.println(jsonObject);
/* 63 */     out.flush();
/* 64 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.UpdateImportantDate
 * JD-Core Version:    0.6.1
 */